# http header
API_URL = 'https://www.okex.com'
ENDPOINT = 'wss://real.okex.com:8443/ws/v3' 
API_KEY = ''
API_SECRET = ''
PASSPHRASE = ''
CONTENT_TYPE = 'Content-Type'
OK_ACCESS_KEY = 'OK-ACCESS-KEY'
OK_ACCESS_SIGN = 'OK-ACCESS-SIGN'
OK_ACCESS_TIMESTAMP = 'OK-ACCESS-TIMESTAMP'
OK_ACCESS_PASSPHRASE = 'OK-ACCESS-PASSPHRASE'

#币种模型初始化配置
OK_SYMBOLS_CONFILE = './config/okex_config.csv'

#7币种模型
#交易货币list,eth以太币,eos柚子币,bch比特现金,trx波场币,xrp瑞波币,ltc莱特币,btc比特币
#BASE_LIST = ['ETH','EOS','BCH','TRX','XRP','LTC','BTC']
#7币基础交易模型-旧模型-45分钟模型配置
#OK_CFG_PATH = './config/net_config.json.17700'
#7币基础交易模型-旧模型-45分钟模型路径
#OK_MODEL = './model/model.ckpt-17700'
#7币基础交易模型-新模型-45分钟模型配置
#OK_CFG_PATH = './config/net_config.json.17700'
#7币基础交易模型-新模型-45分钟模型路径
#OK_MODEL = './model/model.ckpt-16800'
#7币基础交易模型-新模型-15分钟模型配置
#OK_CFG_PATH_15MIN = ''
#7币基础交易模型-新模型-15分钟模型路径
#OK_MODEL_15MIN = ''

#6币种模型
#BASE_LIST = ['ETH','EOS','BCH','XRP','LTC','BTC']
#6币基础交易模型-45分钟模型配置
#OK_CFG_PATH = './config/net_config.json.88800'
#6币基础交易模型-45分钟模型路径
#OK_MODEL = './model/model.ckpt-88800'
#5币高频交易模型-15分钟模型配置
#OK_CFG_PATH_15MIN = ''
#5币高频交易模型-15分钟模型路径
#OK_MODEL_15MIN = ''

#5币种模型
BASE_LIST = ['ETH','EOS','BCH','LTC','BTC']
#5币基础交易模型-45分钟模型配置
#OK_CFG_PATH = './config/net_config.json.45500'
#5币基础交易模型-45分钟模型路径-7val
#OK_MODEL = './model/model.ckpt-45500'
#term3-20191025
#OK_MODEL = './model/model.ckpt-141400'
#soft
#OK_MODEL = './model/model.ckpt-51000'
#flex
#OK_MODEL = './model/model.ckpt-209700'
#5币deeper
OK_CFG_PATH = './config/net_config_4.json'
OK_MODEL = './model/model.ckpt-305100'
#5币高频交易模型-15分钟模型配置
OK_CFG_PATH_15MIN = ''
#5币高频交易模型-15分钟模型路径
OK_MODEL_15MIN = ''
#5币高频交易模型-15分钟模型配置
#OK_CFG_PATH_15MIN = './config/net_config.json.77900'
#5币高频交易模型-15分钟模型路径
#OK_MODEL_15MIN = './model/model.ckpt-22700'

#计价货币,usdt美元代币
QUOTE_CURRENCY = 'USDT'
#计价货币持仓比例
QUOTE_CURRENCY_RATIO = 0.001
#QUOTE_CURRENCY_RATIO = 0.5

#模型数据
#模型输入数据类型
FIELD_LIST = ['ma40','high','low','close']
#模型输入窗口个数
WINDOW_SIZE = 31
#基础模型一个窗口时长
PERIOD_NUMBER = 45 
PERIOD_UNIT = 'min' 
#高频模型一个窗口时长
#15分钟模型窗口时长
PERIOD_NUMBER_15MIN = 15 
PERIOD_UNIT_15MIN = 'min' 

#15分钟切换-BTC-USDT交易量
BTC_USDT_VOLUME_LIMIT = 500
#15分钟切换-执行15分钟交易窗口数
CHANGE_MODEL_NUMBER_15MIN = 11

#下单状态:1.卖单挂单sell_resting_order,2.卖单追单sell_after_order,3.买单挂单buy_resting_order,4.买单追单buy_after_order,5.取消订单cancel_order
#挂单执行时间戳,默认最大值9999999999不可执行
MAX_TIMESTAMP = 9999999999

#-------------------------1.卖单挂单sell_resting_order
#卖挂单每次挂总交易量比率
SELL_RESTING_ORDER_LIMIT_VOLUME_RATIO = 1.00
#卖挂单默认限制比率,-低于close价格挂卖单,+高于close价格挂卖单
SELL_RESTING_ORDER_LIMIT_RATIO = -0.005
#卖挂单最低价格限制比率
SELL_RESTING_ORDER_LIMIT_RATIO_MAX = -0.01
#卖挂单限制深度,在n档价格以内挂卖单
SELL_RESTING_ORDER_LIMIT_LEVEL = 9 
#卖挂单挂单策略:1.当前深度各价格挂单量+n档价格分之一的成交量;2.当前深度各价格挂单量比率;3.总调仓量的n档价格分之一的成交量
SELL_RESTING_ORDER_METHOD_ID = 1 

#15分钟-卖挂单默认限制比率,-低于close价格挂卖单,+高于close价格挂卖单
SELL_RESTING_ORDER_LIMIT_RATIO_15MIN = -0.000
#卖挂单最低价格限制比率
SELL_RESTING_ORDER_LIMIT_RATIO_MAX_15MIN = -0.005
#15分钟-卖单限制深度,在n档以内挂卖单
SELL_RESTING_ORDER_LIMIT_LEVEL_15MIN = 10 

#-------------------------1-1.卖单实时挂单realtime_sell_resting_order
#卖实时挂单取卖挂单N档askn价格比对当前最低下单价格调整挂单位置,默认0为ask1价格
SELL_RESTING_ORDER_LIMIT_POSITION_FRONT = 0 
#卖挂单后退位置0为ask1位置,默认1为ask2的位置
SELL_RESTING_ORDER_LIMIT_POSITION_BACK = 1 
#实时卖挂单间隔时间
REALTIME_SELL_RESTING_ORDER_INTERVAL_TIMESTAMP = 5 

#-------------------------2.卖追单时间sell_after_order
#卖追单计算基于从下单开始增量时间n秒
SELL_AFTER_ORDER_TIMESTAMP_ADD = 999*60 
#卖追单限价比率,最低价追单小于close价格千5卖出
SELL_AFTER_ORDER_LIMIT_RATIO = -0.01 

#15分钟-卖追单计算基于从下单开始增量时间n秒
SELL_AFTER_ORDER_TIMESTAMP_ADD_15MIN = 999*60 
#15分钟-卖追单限价比率,最低价追单小于close价格千5卖出
SELL_AFTER_ORDER_LIMIT_RATIO_15MIN = -0.005 

#-------------------------2-1.卖实时追单时间realtime_sell_after_order
#卖单实时追单计算基于从下单开始增量时间n秒
REALTIME_SELL_AFTER_ORDER_TIMESTAMP_ADD = 999*60 
#卖单实时追单限价比率,最低价追单小于close价格千5卖出
REALTIME_SELL_AFTER_ORDER_LIMIT_RATIO = -0.005

#15分钟-卖单实时追单计算基于从下单开始增量时间n秒
REALTIME_SELL_AFTER_ORDER_TIMESTAMP_ADD_15MIN = 999*60 
#15分钟-卖单实时追单限价比率,最低价追单小于close价格千5卖出
REALTIME_SELL_AFTER_ORDER_LIMIT_RATIO_15MIN = -0.005

#-------------------------3.买挂单buy_resting_order
#买挂单每次挂总交易量比率
BUY_RESTING_ORDER_LIMIT_VOLUME_RATIO = 1.00
#买挂单默认限制比率,-低于close价格挂买单,+高于close价格挂买单
BUY_RESTING_ORDER_LIMIT_RATIO = 0.005
#买挂单最高价格限制比率
BUY_RESTING_ORDER_LIMIT_RATIO_MAX = 0.01
#买挂单限制深度,在n档价格以内挂买单
BUY_RESTING_ORDER_LIMIT_LEVEL = 9 
#买挂单挂单策略:1.当前深度各价格挂单量+n档价格分之一的成交量;2.当前深度各价格挂单量比率;3.总调仓量的n档价格分之一的成交量
BUY_RESTING_ORDER_METHOD_ID = 3 

#15分钟-买挂单默认限制比率,-低于close价格挂买单,+高于close价格挂买单
BUY_RESTING_ORDER_LIMIT_RATIO_15MIN = 0.000
#卖挂单最低价格限制比率
BUY_RESTING_ORDER_LIMIT_RATIO_MAX_15MIN = 0.005
#15分钟-买单限制深度,在n档以内挂买单
BUY_RESTING_ORDER_LIMIT_LEVEL_15MIN = 10 

#-------------------------3-1.单实时挂单realtime_buy_resting_order
#买单实时挂单取买挂单N档bidn价格比对当前最高下单价格调整挂单位置,默认0为bid1价格
BUY_RESTING_ORDER_LIMIT_POSITION_FRONT = 0 
#买单挂单后退位置0为bid1位置,默认1为bid2的位置
BUY_RESTING_ORDER_LIMIT_POSITION_BACK = 1 
#实时买挂单间隔时间
REALTIME_BUY_RESTING_ORDER_INTERVAL_TIMESTAMP = 5 

#-------------------------4.买追单时间buy_after_order
#买追单计算基于从下单开始增量时间n秒
BUY_AFTER_ORDER_TIMESTAMP_ADD = 35*60 
#买追单限价比率,最低价追单大于close价格千5买入
BUY_AFTER_ORDER_LIMIT_RATIO = 0.01 

#15分钟-买追单执行时间戳,默认最大值9999999999不可执行
BUY_AFTER_ORDER_TIMESTAMP_ADD_15MIN = 7*60 
#15分钟-买追单限价比率,最低价追单大于close价格千5买入
BUY_AFTER_ORDER_LIMIT_RATIO_15MIN = 0.005 

#-------------------------4-1.买实时追单时间
#买单实时追单计算基于从下单开始增量时间n秒
REALTIME_BUY_AFTER_ORDER_TIMESTAMP_ADD = 999*60 
#买单实时追单限价比率,最高价追单大于close价格千5买入
REALTIME_BUY_AFTER_ORDER_LIMIT_RATIO = 0.005 

#15分钟-买单实时追单计算基于从下单开始增量时间n秒
REALTIME_BUY_AFTER_ORDER_TIMESTAMP_ADD_15MIN = 999*60 
#15分钟-买单实时追单限价比率,最高价追单大于close价格千5买入
REALTIME_BUY_AFTER_ORDER_LIMIT_RATIO_15MIN = 0.005 

#-------------------------5.取消订单时间cancel_order
#取消订单计算基于从下单开始增量时间n秒
CANCEL_ORDER_TIMESTAMP_ADD = 38*60 

#15分钟-取消订单计算基于从下单开始增量时间n秒
CANCEL_ORDER_TIMESTAMP_ADD_15MIN = 8*60 

ACEEPT = 'Accept'
COOKIE = 'Cookie'
LOCALE = 'Locale='

APPLICATION_JSON = 'application/json'

GET = "GET"
POST = "POST"
DELETE = "DELETE"

SERVER_TIMESTAMP_URL = '/api/general/v3/time'

# account

CURRENCIES_INFO = '/api/account/v3/currencies'
WALLET_INFO = '/api/account/v3/wallet'
CURRENCY_INFO = '/api/account/v3/wallet/'
COIN_TRANSFER = '/api/account/v3/transfer'
COIN_WITHDRAW = '/api/account/v3/withdrawal'
COIN_FEE = '/api/account/v3/withdrawal/fee'
COINS_WITHDRAW_RECORD = '/api/account/v3/withdrawal/history'
COIN_WITHDRAW_RECORD = '/api/account/v3/withdrawal/history/'
LEDGER_RECORD = '/api/account/v3/ledger'
TOP_UP_ADDRESS = '/api/account/v3/deposit/address'
COIN_TOP_UP_RECORDS = '/api/account/v3/deposit/history'
COIN_TOP_UP_RECORD = '/api/account/v3/deposit/history/'

# spot
SPOT_ACCOUNT_INFO = '/api/spot/v3/accounts'
SPOT_COIN_ACCOUNT_INFO = '/api/spot/v3/accounts/'
SPOT_LEDGER_RECORD = '/api/spot/v3/accounts/'
SPOT_ORDER = '/api/spot/v3/orders'
SPOT_ORDERS = '/api/spot/v3/batch_orders'
SPOT_REVOKE_ORDER = '/api/spot/v3/cancel_orders/'
SPOT_REVOKE_ORDERS = '/api/spot/v3/cancel_batch_orders/'
SPOT_ORDERS_LIST = '/api/spot/v3/orders'
SPOT_ORDERS_PENDING = '/api/spot/v3/orders_pending'
SPOT_ORDER_INFO = '/api/spot/v3/orders/'
SPOT_FILLS = '/api/spot/v3/fills'
SPOT_COIN_INFO = '/api/spot/v3/instruments'
SPOT_DEPTH = '/api/spot/v3/instruments/'
SPOT_TICKER = '/api/spot/v3/instruments/ticker'
SPOT_SPECIFIC_TICKER = '/api/spot/v3/instruments/'
SPOT_DEAL = '/api/spot/v3/instruments/'
SPOT_KLINE = '/api/spot/v3/instruments/'

# lever
LEVER_ACCOUNT = '/api/margin/v3/accounts'
LEVER_COIN_ACCOUNT = '/api/margin/v3/accounts/'
LEVER_LEDGER_RECORD = '/api/margin/v3/accounts/'
LEVER_CONFIG = '/api/margin/v3/accounts/availability'
LEVER_SPECIFIC_CONFIG = '/api/margin/v3/accounts/'
LEVER_BORROW_RECORD = '/api/margin/v3/accounts/'
LEVER_SPECIFIC_BORROW_RECORD = '/api/margin/v3/accounts/'
LEVER_BORROW_COIN = '/api/margin/v3/accounts/borrow'
LEVER_REPAYMENT_COIN = '/api/margin/v3/accounts/repayment'
LEVER_ORDER = '/api/margin/v3/orders'
LEVER_ORDERS = '/api/margin/v3/batch_orders'
LEVER_REVOKE_ORDER = '/api/margin/v3/cancel_orders/'
LEVER_REVOKE_ORDERS = '/api/margin/v3/cancel_batch_orders'
LEVER_ORDER_LIST = '/api/margin/v3/orders'
LEVEL_ORDERS_PENDING = '/api/margin/v3/orders_pending'
LEVER_ORDER_INFO = '/api/margin/v3/orders/'
LEVER_FILLS = '/api/margin/v3/fills'
FF = '/api/futures/v3/orders'

# future
FUTURE_POSITION = '/api/futures/v3/position'
FUTURE_SPECIFIC_POSITION = '/api/futures/v3/'
FUTURE_ACCOUNTS = '/api/futures/v3/accounts'
FUTURE_COIN_ACCOUNT = '/api/futures/v3/accounts/'
FUTURE_GET_LEVERAGE = '/api/futures/v3/accounts/'
FUTURE_SET_LEVERAGE = '/api/futures/v3/accounts/'
FUTURE_LEDGER = '/api/futures/v3/accounts/'
FUTURE_DELETE_POSITION = '/api/futures/v3/close_all_orders'
FUTURE_ORDER = '/api/futures/v3/order'
FUTURE_ORDERS = '/api/futures/v3/orders'
FUTURE_REVOKE_ORDER = '/api/futures/v3/cancel_order/'
FUTURE_REVOKE_ORDERS = '/api/futures/v3/cancel_batch_orders/'
FUTURE_ORDERS_LIST = '/api/futures/v3/orders'
FUTURE_ORDER_INFO = '/api/futures/v3/orders/'
FUTURE_FILLS = '/api/futures/v3/fills'
FUTURE_PRODUCTS_INFO = '/api/futures/v3/instruments'
FUTURE_DEPTH = '/api/futures/v3/instruments/'
FUTURE_TICKER = '/api/futures/v3/instruments/ticker'
FUTURE_SPECIFIC_TICKER = '/api/futures/v3/instruments/'
FUTURE_TRADES = '/api/futures/v3/instruments/'
FUTURE_KLINE = '/api/futures/v3/instruments/'
FUTURE_INDEX = '/api/futures/v3/instruments/'
FUTURE_RATE = '/api/futures/v3/rate'
FUTURE_ESTIMAT_PRICE = '/api/futures/v3/instruments/'
FUTURE_HOLDS = '/api/futures/v3/instruments/'
FUTURE_LIMIT = '/api/futures/v3/instruments/'
FUTURE_LIQUIDATION = '/api/futures/v3/instruments/'
FUTURE_MARK = '/api/futures/v3/instruments/'
HOLD_AMOUNT = '/api/futures/v3/accounts/'
#CURRENCY_LIST = '/api/futures/v3/instruments/currencies/'

# ETT
ETT_ACCOUNTS = '/api/ett/v3/accounts'
ETT_ACCOUNT = '/api/ett/v3/accounts/'
ETT_LEDGER = '/api/ett/v3/accounts/'
ETT_ORDER = '/api/ett/v3/orders'
ETT_REVOKE = '/api/ett/v3/orders/'
ETT_ORDER_LIST = '/api/ett/v3/orders'
ETT_SPECIFIC_ORDER = '/api/ett/v3/orders/'
ETT_CONSTITUENTS = '/api/ett/v3/constituents/'
ETT_DEFINE = '/api/ett/v3/define-price/'

# SWAP
SWAP_POSITIONS = '/api/swap/v3/position'
SWAP_POSITION = '/api/swap/v3/'
SWAP_ACCOUNTS = '/api/swap/v3/accounts'
SWAP_ACCOUNT = '/api/swap/v3/'
SWAP_ORDER = '/api/swap/v3/order'
SWAP_ORDERS = '/api/swap/v3/orders'
SWAP_CANCEL_ORDER = '/api/swap/v3/cancel_order/'
SWAP_CANCEL_ORDERS = '/api/swap/v3/cancel_batch_orders/'
SWAP_FILLS = '/api/swap/v3/fills'
SWAP_INSTRUMENTS = '/api/swap/v3/instruments'
SWAP_TICKETS = '/api/swap/v3/instruments/ticker'
SWAP_RATE = '/api/swap/v3/rate'
